#include <iostream>
#include <fstream>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <numeric>
#include <vector>
#include <iterator>
#include <functional>
#include <boost/bind.hpp>
#include <boost/lambda/lambda.hpp>
#include <boost/timer.hpp>
#include <boost/shared_ptr.hpp>

using namespace std;
using namespace boost::lambda;

bool TRUE(string s)
{
	return true;
}

int accu(int i, string s)
{
	return ++i;
}

int main(int argc, char** argv)
{
	if(argc == 1){
	  cout<<"command file"<<endl;
	  exit(1);
	}
	 
	fstream file;
	file.open(argv[1],ios::in);

	istream_iterator<string> beg(file),end;
//	clock_t t = clock();
//	int wc  = count_if(beg,end,TRUE);
        int wc  = accumulate(beg,end,0,accu);
//	cout<<"TIME:"<<clock()-t<<endl;
	cout<<wc<<endl;

	return 0;
}
